home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _PUTC.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  58 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3.  
  4. #ifndef        NDEBUG
  5. char *rcsid__putc = "$Header: c:/curses/private/RCS/_putc.c%v 2.0 1992/11/15 03:24:30 MH Rel $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_putc()   - Output a character in the current attribute.
  14.  
  15.   PDCurses Description:
  16.        This is a private PDCurses routine.
  17.  
  18.        Outputs character 'chr' to screen in tty fashion. If a colour
  19.        mode is active, the character is written with colour 'colour'.
  20.  
  21.   PDCurses Return Value:
  22.        This function returns OK on success and ERR on error.
  23.  
  24.   PDCurses Errors:
  25.        No errors are defined for this function.
  26.  
  27.   Portability:
  28.        PDCurses        int PDC_putc( chtype character, chtype color );
  29.  
  30. **man-end**********************************************************************/
  31.  
  32. int    PDC_putc( chtype character, chtype color )
  33. {
  34. #ifdef FLEXOS
  35.        int     x = color;
  36.        retcode = s_write(0x00, 0x01L, (_far char *) &character, 1L, 0);
  37.        return( (retcode < 0L) ? ERR : OK );
  38. #endif
  39. #ifdef DOS
  40.        regs.h.ah = 0x0a;       /* Avoid screen wrap.  Don't advance cursor. */
  41.        regs.h.al = (unsigned char) (character & A_CHARTEXT);
  42.        regs.h.bh = _cursvar.video_page;
  43.        regs.h.bl = (unsigned char) ((color & A_ATTRIBUTES) >> 8);
  44.        regs.x.cx = 0;
  45.        int86(0x10, ®s, ®s);
  46.        return( OK );
  47. #endif
  48. #ifdef OS2
  49.        int curRow = PDC_get_cur_row ();
  50.        int curCol = PDC_get_cur_col ();
  51.  
  52.        VioWrtTTY ((PCH)&character, 1, 0);
  53.        VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0);
  54.        PDC_gotoxy (curRow, curCol);
  55.        return( OK );
  56. #endif
  57. }
  58.